﻿@using System.Data;
@model vncom.Models.M_Template_SYS_Edit
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    DataTable dt = (DataTable)ViewData["TemplateSYS_List"];
    int dem = 1;
}
<style type="text/css">
    .border_right
    {
        border-right:1px solid #000000;
        width:20%;
    }
    .left
    {
        width:20%;
    }
    
    #SYS_DanhMucLinhVuc
    {
        width:100%;
        font-size:11px;
        font-family:Verdana;
    }
    .w_STT
    {
        width:7%;
    }
    .w_LinhVuc
    {
        
    }
    .w_HoatDong
    {
        width:15%;
    }
    .w_XuLy
    {
        width:7%;
    }
    .title_Header
    {
        background-color:Blue;
        color:White;
        font-weight:bold;
        text-align:center;
    }
</style>
<table style="width: 100%;" border="0" cellpadding="0" cellspacing="3">
    <tr>
        <td valign="top" class="border_right">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr><td><a href="/Administrator/ThietLapTemplate">- Thiết lập template</a></td></tr>
                <tr><td><a href="/Administrator/TemplateCreate">- Thêm mới template</a></td></tr>
            </table>
        </td>
        <td valign="top">
            @using (Html.BeginForm("ThietLapTemplate", "Administrator", FormMethod.Post))
            {
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="left">
                        Chọn lĩnh vực
                    </td>
                    <td>
                        <select id="SYS_DanhMucLinhVuc" name="SYS_DanhMucLinhVuc">
                            <option value="0">-- Chọn lĩnh vực --</option>
                            @foreach (var item in Model.ListDanhMucLinhVuc)
                            {
                                if (item.DanhMucLinhVucID == Model.DMLinhVucID)
                                {
                                    <option selected="selected" value="@item.DanhMucLinhVucID">@item.TenLinhVuc</option>
                                }
                                else
                                {
                                    <option value="@item.DanhMucLinhVucID">@item.TenLinhVuc</option>
                                }
                            }                            
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="left">
                        Hoạt động
                    </td>
                    <td>
                        @Html.CheckBoxFor(model => model.HoatDong)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input id="btnTimKiem" name="btnTimKiem" type="submit" value="Tìm kiếm" />
                    </td>
                </tr>
            </table>
            }
            <br />
            <table style="width: 100%;" border="1" cellpadding="3" cellspacing="0">
                <tr>
                    <td class="w_STT title_Header" align="center">
                        STT
                    </td>
                    <td class="title_Header">
                        Lĩnh vực hoạt động
                    </td>
                    <td class="w_HoatDong title_Header" align="center">
                        Hoạt động
                    </td>
                    <td class="title_Header">Xử lý</td>
                </tr>
                @for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string check = "unchecked.gif";
                    if ((Boolean)dt.Rows[i]["HoatDong"] == true)
                    {
                        check = "checked.gif";
                    }
                <tr>
                    <td class="w_STT" align="center">@(dem + i)</td>
                    <td><a href="/Administrator/TemplateEdit/@dt.Rows[i]["TemplateID"]">@dt.Rows[i]["DMLinhVucID"]</a></td>
                    <td class="w_HoatDong" align="center">
                        <img alt="" src="/Images/Icons/@check" />
                    </td>
                    <td class="w_XuLy" align="center"><a href="/Danhmucsys/DanhmucsysList/@dt.Rows[i]["TemplateID"]"><img alt="" src="/Images/Icons/Rt_16X16_Standard.png" /></a></td>
                </tr>
                }
            </table>
        </td>
    </tr>
</table>
